package com.blkj.modular.article.controller;

import com.blkj.common.core.entity.ArticleEntity;
import com.blkj.modular.article.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author 北浪 2021/11/30
 */
@Controller
@RequestMapping("/article")
public class WebArticleController {

    @Autowired
    ArticleService articleService;

    @RequestMapping
    public String getArticleById(String id,Model model){
        ArticleEntity entity = articleService.getById(id);
        model.addAttribute("post",entity);
        return "article";
    }
}
